﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace Manage
{
    public partial class ChangePassword : Form
    {
        public ChangePassword()
        {
            InitializeComponent();
        }

        private void btResetPassword_Click(object sender, EventArgs e)
        {
            if (tbOldPassrod.Text == "" || tbNewPassword.Text == "")
            {
                MessageBox.Show("原密码、新密码不能为空！");
                return;
            }
            if (tbNewPassword.Text != tbNewPassword2.Text)
            {
                MessageBox.Show("新密码不一致！");
                return;
            }
            Dictionary<string, string> msg =ThisLink.cRequst.ResetPassword(tbOldPassrod.Text, tbNewPassword.Text);
            if (msg["status"] == "")
            {
                tbNewPassword2.Text = tbNewPassword.Text = tbOldPassrod.Text = "";
            }

            MessageBox.Show(msg["message"]);
        }
    }
}
